package com.sparrow.core.asm;

import com.sparrow.core.Cache;

public class DynamicCompilerTest {
	public static void main(String[] args) throws Exception {
		MethodAccessor ma = Generator4MethodAccessor.getInstance()
				.newMothodAccessor(Cache.class);

		System.out.println("this is ok:"
				+ ma.get(Cache.getInstance(), "getInstance"));
		/*
		 * String fullName = "DynaClass"; StringBuilder src = new
		 * StringBuilder(); src.append("public class DynaClass {\n");
		 * src.append("    public String toString() {\n");
		 * src.append("        return \"Hello, I am \" + ");
		 * src.append("this.getClass().getSimpleName();\n");
		 * src.append("    }\n"); src.append("}\n");
		 * 
		 * System.out.println(src); DynamicEngine de =
		 * DynamicEngine.getInstance(); Object instance =
		 * de.javaCodeToObject(fullName, src.toString());
		 * System.out.println(instance);
		 */
	}
}
